﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Game1942.Library.Background;

namespace Game1942.Library.FlightPlans
{   
    class RoundTripStrategy : FlightPlan
    {
        private int downCycle;

		// Constructor with the original direction
        public RoundTripStrategy(int speed, int aDownCycle): base(speed)
        {
            downCycle = aDownCycle;
        }

        // Get the next point on the trajectory of the flight plan
		// Based on the direction
        public override Point GetNext()
        {
            if (downCycle > 0)
            {
                actualPosition = new Point(actualPosition.X, actualPosition.Y + 1);
                downCycle -= 1;
            }
            else
            {
                actualPosition = new Point(actualPosition.X, actualPosition.Y - 1);
            }
            return actualPosition;
        }
    }
}
